<?php
class Pageley_Log_FileAppender extends Pageley_Log_AbstractAppender {
	private $logFile;
	
	public function setLogFilePath($logFilePath) {
		$this->logFile = new Pageley_Util_File($logFilePath);
	}
	
	protected function getLogFile() {
		return $this->logFile;
	}
	
	protected function appendInternal($message) {
		$this->appendToFile($message, $this->getLogFile());
	}
	
	protected function appendToFile($message, $file) {
		$fileWriter = new Pageley_Util_FileWriter($file);
		$writer = new Pageley_Util_BufferedWriter($fileWriter);
		$writer->writeLine($message);
		$writer->close();
	}
}